( long "not-only-annex"
<> help "operate on git branches as well as annex"
)
- <*> unlesssync False (switch
+ <*> unlessmode SyncMode False (switch
( long "commit"
<> help "commit changes to git"
))
- <*> unlesssync True (switch
+ <*> unlessmode SyncMode True (switch
( long "no-commit"
<> help "avoid git commit"
))
- <*> unlesssync Nothing (optional (strOption
+ <*> unlessmode SyncMode Nothing (optional (strOption
( long "message" <> short 'm' <> metavar "MSG"
<> help "commit message"
)))
<> help "transfer contents of annexed files in a given location"
<> metavar paramPath
))
- <*> unlesssync False (switch
+ <*> unlessmode PullMode False (switch
( long "cleanup"
<> help "remove synced/ branches from previous sync"
))
<*> optional parseAllOption
- <*> case mode of
- PushMode -> pure False
- _ -> invertableSwitch "resolvemerge" True
- ( help "do not automatically resolve merge conflicts"
- )
+ <*> unlessmode PushMode False (invertableSwitch "resolvemerge" True
+ ( help "do not automatically resolve merge conflicts"
+ ))
<*> case mode of
PushMode -> pure False
_ -> parseUnrelatedHistoriesOption
<*> pure mode
where
- unlesssync v a = case mode of
- SyncMode -> a
- _ -> pure v
+ unlessmode m v a
+ | mode /= m = a
+ | otherwise = pure v
parseUnrelatedHistoriesOption :: Parser Bool
parseUnrelatedHistoriesOption =
repository. (Unless the remote is configured with
receive.denyCurrentBranch=updateInstead.)
-To make working with such non-bare remotes easier, this command pushes not only
-local `master` to remote `master`, but also to remote `synced/master` (and
-similar with other branches). When `git-annex pull` (or `git-annex sync`)
-is later run on the remote, it will merge the `synced/` branches that
-were pushed to it.
+To make working with such non-bare remotes easier, this command pushes not
+only local `master` to remote `master`, but also to remote `synced/master`
+(and similar with other branches). When `git-annex pull` (or `git-annex
+sync`) is later run on the remote, it will merge the `synced/` branches
+that were pushed to it.
Some special remotes allow exporting a tree of files to them,
and this command can be used to push to those remotes as well
Setting this to "cpus" will run one job per CPU core.
+* `--cleanup`
+
+ Removes the local and remote `synced/` branches, which were created
+ and pushed by `git-annex push` or `git-annex sync`. This option
+ prevents all other activities.
+
+ This can come in handy when you've pushed a change to remotes and now
+ want to reset your master branch back before that change. So you
+ run `git reset` and force-push the master branch to remotes, only
+ to find that the next `git annex merge` or `git annex pull` brings the
+ changes back. Why? Because the `synced/master` branch is hanging
+ around and still has the change in it. Cleaning up the `synced/` branches
+ prevents that problem.
+
* Also the [[git-annex-common-options]](1) can be used.
# SEE ALSO
When `remote.<name>.annex-sync` is set to false, pushing is disabled for
that remote, and using `--push` will not enable it.
-* `--cleanup`
-
- Removes the local and remote `synced/` branches, which were created
- and pushed by `git-annex sync`. This option prevents all other syncing
- activities.
-
- This can come in handy when you've synced a change to remotes and now
- want to reset your master branch back before that change. So you
- run `git reset` and force-push the master branch to remotes, only
- to find that the next `git annex merge` or `git annex sync` brings the
- changes back. Why? Because the `synced/master` branch is hanging
- around and still has the change in it. Cleaning up the `synced/` branches
- prevents that problem.
-
* Also all options supported by [[git-annex-pull]](1) and
[[git-annex-push]](1) can be used.